package cn.itlaobing.eshopmanagement.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.itlaobing.eshopmanagement.entity.Focus;
import cn.itlaobing.eshopmanagement.mapper.FocusMapper;
import cn.itlaobing.eshopmanagement.service.FocussService;

@Service
public class FocussServiceImpl implements FocussService {

	@Autowired
	private FocusMapper focusMapper;

	@Override
	public List<Focus> selectByPrimaryAll(Map<String, String> map) {
		if (map == null) {
			map = new HashMap<>();
		}
		if (StringUtils.isBlank(map.get("pageNum"))) {
			map.put("pageNum", "1");
		}
		if (StringUtils.isBlank(map.get("pageSize"))) {
			map.put("pageSize", "5");
		}
		return focusMapper.selectByPrimaryAll(map);
	}

	@Override
	public Focus selectByPrimaryKey(Long id) {
		return focusMapper.selectByPrimaryKey(id);
	}

	@Override
	public int deleteByPrimaryKey(Long id) {
		return focusMapper.deleteByPrimaryKey(id);
	}
	
}
